var  t = document.querySelector("#hui");
window.onscroll = function () {
    if (document.documentElement.scrollTop > 1000 || document.body.scrollTop > 1000 ){
        t.style.display = "block";
    }else {
        t.style.display = "none";
    }
};
//点击返回顶部
t.addEventListener('click',function () {
    //让scollTop 支持平滑滚动
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});



//分类-移入移出事件
var flw = document.querySelector("#flw");
var dt_nav_content = document.querySelector("#dt-nav-content");

//移入事件
flw.addEventListener("mouseover",function () {
    /*console.log("谁在上面？");*/
    dt_nav_content.style.display = "block";
});
//移出事件  onmouseout 这个移出事件有BUG，所以替换成了 mouseleave
dt_nav_content.addEventListener("mouseleave",function () {
    /*console.log("离开了");*/
    dt_nav_content.style.display = "none";
});


//轮播
var swiper = new Swiper('.swiper-container', {
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
    pagination: {
        el: '.swiper-pagination',
    },
    loop:true
});
